import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class TableroFrame extends javax.swing.JFrame {
	private JPanel PanelFondo;
	private JLabel JLabelFondo;
	private JPanel PanelPresentacion;
	private JLabel JLabelFondoPresentacion;
	private JLabel FichaNegra;
	private JButton JBotonSalir;
	private JButton JBotonIniciarJuego;

	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				TableroFrame inst = new TableroFrame();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});
	}
	
	public TableroFrame() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			getContentPane().setLayout(null);
			setTitle("Go!");
			{
				PanelFondo = new JPanel();
				//getContentPane().add(PanelFondo);
				PanelFondo.setBounds(0, 0, 784,600);
				PanelFondo.setLayout(null);
				{
					JLabelFondo = new JLabel();
					PanelFondo.add(JLabelFondo);
					JLabelFondo.setBounds(0, 0, 600, 600);
					JLabelFondo.setIcon(new ImageIcon("C:/Users/Luciano/Pictures/TableroGo2.png"));
					{
						FichaNegra = new JLabel();
						JLabelFondo.add(FichaNegra);
						FichaNegra.setBounds(470, 100, 35, 30);
						FichaNegra.setIcon(new ImageIcon("C:/Users/Luciano/Pictures/NegraChica.png"));
					}
					JLabelFondo.addMouseListener(new MouseAdapter() {
						public void mouseClicked(MouseEvent evt) {
							JLabelFondoMouseClicked(evt);
						}
					});
				}
			}
			{
				PanelPresentacion = new JPanel();
				getContentPane().add(PanelPresentacion);
				PanelPresentacion.setBounds(0, 0, 784, 598);
				PanelPresentacion.setLayout(null);
				{
					JLabelFondoPresentacion = new JLabel();
					PanelPresentacion.add(JLabelFondoPresentacion);
					JLabelFondoPresentacion.setBounds(0, 0, 784, 598);
					JLabelFondoPresentacion.setIcon(new ImageIcon("C:/Users/Luciano/Pictures/Fondo3.jpg"));
				}
				{
					JBotonIniciarJuego = new JButton();
					JLabelFondoPresentacion.add(JBotonIniciarJuego);
					JBotonIniciarJuego.setText("Nuevo Juego");
					JBotonIniciarJuego.setBounds(300, 215, 194, 57);
					JBotonIniciarJuego.addMouseListener(new MouseAdapter() {
						public void mouseClicked(MouseEvent evt) {
							JBotonIniciarJuegoMouseClicked(evt);
						}
					});
				}
				{
					JBotonSalir = new JButton();
					JLabelFondoPresentacion.add(JBotonSalir);
					JBotonSalir.setText("Salir del Juego");
					JBotonSalir.setBounds(300, 330, 194, 63);
					JBotonSalir.setSize(194, 57);
					JBotonSalir.addMouseListener(new MouseAdapter() {
						public void mouseClicked(MouseEvent evt) {
							JBotonSalirMouseClicked(evt);
						}
					});
				}
			}
			pack();
			setSize(800, 635);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}
	
	private void iniciarJuego(){
		getContentPane().add(PanelFondo);
		PanelFondo.repaint();
	}
	
	private void JBotonSalirMouseClicked(MouseEvent evt) {
		System.out.println("JBotonSalir.mouseClicked, event="+evt);
		//TODO add your code for JBotonSalir.mouseClicked
		System.exit(0);
	}
	
	private void JBotonIniciarJuegoMouseClicked(MouseEvent evt) {
		System.out.println("JBotonIniciarJuego.mouseClicked, event="+evt);
		//TODO add your code for JBotonIniciarJuego.mouseClicked
		getContentPane().remove(PanelPresentacion);
		iniciarJuego();
	}
	
	private void JLabelFondoMouseClicked(MouseEvent evt) {
		System.out.println("JLabelFondo.mouseClicked, event="+evt);
		//TODO add your code for JLabelFondo.mouseClicked
	}

}
